<%@page import="helpers.UrlHelper"%>
<%@page import="helpers.StringHelper"%>
<%@page import="entities.Page"%>
<%
Page pages = (Page) request.getAttribute("page");

//Value for seo
String title = "WikiMedical: " + pages.getTitle();
String description = StringHelper.cutString(StringHelper.html2text(pages.getContent()), 50) ;
String keywords = pages.getTitle() + ", Wiki Medical, MedlinePlus, Health Information, Drugs and Supplements , Dictionaries, Directories, Other Resources, Health News, Featured Health Site, Clinical Trials, NIHSeniorHealth, Interactive Tutorials, clinicaltrials.gov, National Library of Medicine, National Institutes of Health";
String url = pages.getUrl().replace("http://www.nlm.nih.gov", UrlHelper.getServerUrl(request));
String ogimage = pages.getImage();

//Set url related
String urlVideo = "http://video.wikimedical.info/search/" + pages.getTitle().replace(" ", "+");
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<jsp:include page="/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="keywords" value="<%=keywords %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogimage" value="<%=ogimage %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

	<div class="row-fluid">
	  <div class="span12">
	    <div class="row-fluid">
	      <div class="span9">
	      	<div id="topic_content">
	      		<section class="blockContent">
					<h1>
						<a class="video_related" href="<%=urlVideo %>" target="_blank" alt="Video related"><%=pages.getTitle() %></a>
					</h1>
			
					<h4>
						<%=pages.getSortTitle() %>
					</h4>
					
					<% if (!pages.getImage().isEmpty()) { %>
					<img src="<%=pages.getImage() %>" />
					<% } %>					
					<%=pages.getContent() %>
					
					
					<!-- ADV -->
					<script type="text/javascript"><!--
					google_ad_client = "ca-pub-2883566427648799";
					/* link_menu 468x15 */
					google_ad_slot = "8735411486";
					google_ad_width = 468;
					google_ad_height = 15;
					//-->
					</script>
					<script type="text/javascript"
					src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
					</script>
					<!-- End ADV -->
					<br />
					<br />
				</section>
				
				<% if (!pages.getArticle().isEmpty()) { %>
				<div class="related_article">
					<div class="adv right">
						<script type="text/javascript"><!--
						google_ad_client = "ca-pub-2883566427648799";
						/* 300x250 */
						google_ad_slot = "2688877886";
						google_ad_width = 300;
						google_ad_height = 250;
						//-->
						</script>
						<script type="text/javascript"
						src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
						</script>
					</div>
					<%=pages.getArticle() %>
				</div>
				<% } %>
			</div>
	      </div>
	      <div class="span3 pagination-centered">
	      		<jsp:include page="/elements/right.jsp" />
	      </div>
	    </div>
	  </div>
	</div>

<jsp:include page="/layouts/footer.jsp" />